package core.actor.player
{
	import core.actor.core.ActorView;
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.geom.Point;
	import flash.utils.getTimer;
	

	public class PlayerActor extends ActorView
	{
		private var _myMove:Move;
		private var _myDust:Dust;
		private var n:Number=0;
		public function PlayerActor()
		{
			initLayer("0,0,-1,-1,-1");
			initTitle("测试人物");
			_myMove = new Move();
			
			//TODO：初始化默认动作，骨骼
		}
		
		
		public function set title(val:String):void
		{
			_title.text = val;
		}
		
		private function moveTest(x:Number,y:Number):void
		{
			if((n++)%3==0)
			{
				_myDust = new Dust("../testRes/Dust.swf");
				_myDust.x = this.x + 120 - 2.5*x;
				_myDust.y = this.y + 210 - 2.5*y;
				stage.addChild(_myDust);
			}
		
			this.x += x + 150;
			this.y += y + 270;
		}
		
		public function doMove():void
		{
			_myMove.goto(new Point(this.x+150,this.y+270),new Point(stage.mouseX,stage.mouseY),12,moveTest);
		}
	}
}